import { RequestConfig ,history } from 'umi';
const baseURL = "https://api.blog.wipi.tech/";

export const request: RequestConfig = {
    timeout: 1000,
    errorConfig: {},
    middlewares: [],
    //请求拦截器
    requestInterceptors: [(url, options) => {
        if (!/http/.test(url)) {
            url = baseURL + url
        }
        return {
            url,
            options: { ...options, interceptors: true, headers: { ...options.headers } },
        };
    }],
    //相应拦截器
    responseInterceptors: [],
};

if(location.pathname === '/'){
    history.replace('/page/Article')
  }
